home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / fndation.arc / DEMO.BAT < prev    next >
DOS Batch File  |  1985-12-13  |  3KB  |  65 lines

  1. Echo off
  2. cls
  3. :BEGIN
  4. :The previous line is used as a GOTO label, this line is a comment.
  5. :This batch file was INTENTIONALLY made too long for teaching purposes.
  6. echo ------------------------------------------------------------------------
  7. echo                  FOUNDATION ARTICLE LECTURE ON DISK
  8. echo   Tony Lindsey, (619) 295-2922 3752 Third Avenue, San Diego CA 92103
  9. echo ------------------------------------------------------------------------
  10. echo      Choose one of the below:
  11. echo               1.  To page through the INTRODUCTION on your screen.
  12. echo               2.  To page through the FOUNDATION article on your screen.
  13. echo               3.  To print out the FOUNDATION article on CONTINUOUS,
  14. echo                        PERFORATED PAPER (about 30 pages worth). If you 
  15. echo                        know how to print out something from DOS 
  16. echo                        with pauses between single, cut sheets 
  17. echo                        of paper, PLEASE let me know!
  18. echo   
  19. echo          ESC key.  EXIT MENU AND RETURN TO DOS
  20. echo ------------------------------------------------------------------------
  21. :The next few lines mean that the INPUT command will ONLY accept what 
  22. :characters are in between the quotes (upper or lower case doesn't matter),
  23. :and allows the batch file to branch accordingly by setting the ERRORLEVEL.
  24. INPUT "123"
  25. :Please notice that the following lines MUST 
  26. :have errorlevels in descending order, and the Esc key has a value of 255.
  27. IF ERRORLEVEL 255 GOTO END
  28. IF ERRORLEVEL 3 goto CHOICE3
  29. IF ERRORLEVEL 2 goto CHOICE2
  30. IF ERRORLEVEL 1 goto CHOICE1
  31. GOTO BEGIN
  32. :CHOICE1
  33. :The next line displays INTRO.DOC with the LIST command.
  34. LIST INTRO.TXT
  35. goto more?
  36. :CHOICE2
  37. LIST FNDATION.TXT
  38. goto more?
  39. :CHOICE3
  40. :The next few lines show how the PRNCHECK command detects whether the 
  41. :printer is "on-line", and and branches the batch file accordingly.
  42. :The "if not errorlevel 1 etc." is the ONLY way I can get it to work!
  43. prncheck
  44. if not errorlevel 1 goto NEXT
  45. cls
  46. echo The printer is NOT ready! We need to send a file to the printer, 
  47. echo and it won't work unless all systems are GO.
  48. echo Please get the printer ready, and we'll try it again...
  49. pause
  50. goto BEGIN
  51. :next
  52. :The next line prints out the FNDATION.TXT file.
  53. type FNDATION.TXT >PRN
  54. :MORE?
  55. cls
  56. :The next lines show how the QUERY command detects a "?" and asks (Y or N),
  57. :and then sets a TRUE or FALSE errorlevel.
  58. Echo Would you like to go back to the main menu?
  59. query
  60. cls
  61. if errorlevel 1 goto begin
  62. :END
  63. cls
  64.  
  65.